package com.hbnu;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;

public class OutputStreamWriterDemo01 {
    public static void main(String[] args) {
        String filepath = "E:" + File.separator + "2211.txt";

        File file = new File(filepath);
        try {
            // 写入流，写到文件中去
            OutputStreamWriter outputStreamWriter = new OutputStreamWriter(new FileOutputStream(file));
            String content = "2024年9月27日";
            outputStreamWriter.write(content);

            outputStreamWriter.close();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }


    }
}
